package com.zpark.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号即是您的APPID对应的支付宝账号,开发时使用沙箱提供的APPID，生产环境改成自己的APPID
    public static String APP_ID = "2021000123608058";   //你的沙箱APPID

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String APP_PRIVATE_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCSmtoAa1MwchxRqvGOIguOn4QzfK+zTzRO9EfRIMm5FZsZI/KaPOCN7E+8m0WGquCaclxUCc+fywL9q5isQtP2bsJ7GnMVRGlFxnZd/IHck7UJpQPFhWN1atKAQPXR8cawduVPRJ2G5bLXNcZ5nc8aBuA0ocvXYbwnlnu4XTwxQP0cwOJULdpAkSLKE5Q1zGmZX4XYenwKsQihG4HCZ0Yhx22TP5vL4QOep2hJ6/X+HF9eDs7nMv7Wgxrekunkt9FGwRt3OCsd0i8ljrSQh0GnpW+RcWA85n4r22wqr303+wKbtyS2Owh/bdsJjo491GQLCG23q9y/i6z+BTjHBhmtAgMBAAECggEANpbIhA1ynYBwAQzpAya0LPhCzrUn61mbvaaCM2HFG1DrPrI+/KWca9xJWI5slhd8qKXasUQx9msuguxpXgNIT+OwMQyJO6sMk/mxS4/hfxPU/nFedScVALy1AyKtJe6kMEMlYZ3IFlnjfPU+ITzcx/E1fQOeFmYDHK6RBPZamm/ofsMYRj8+e1VtmN4fSLpqjHnMq/RAEdV2bNbQuYYPdc6CeRUi7quFZHZHaX4C5jXxTx2Wat+T1DinIHb1ry6ZEl9uMXeSeXQSJ6IHoPWftvwiHrl/75RPUK5Dqgfe373CP3Hm+sQNcqt1lrmDV617BsJtb2F2NeKDOOTlAliclQKBgQDryCV5E0PEcloJYxoSL+J2ASfFQnKWXa/Xbl440z3qIFA/7ofmoZ1H6pqjiCLXVMmQ+8RrTNctYwJjwf1gjh0oFv+rWFmaF5mD3rkxYS6AG9acc0FnujT+zWBP+xrdtv8zBhi+gZ78qCmYZxKp4xtre54E3uO16vjq4i856kxXrwKBgQCfLRqmc56+wnov0T8Zsk7AgcZhOCmdCeHP9V4LzW0jhrSzxNf58WQIaP5jLTbrfIJ4OYk4vo+9JMbkplWK880w5xJzRNDokT8VNoejfEAAeOqEvqotpOZ8eUnf33AbSRVjCXbC+gJbpSeI2IT/QAP7MNlzGRmq0YChJ10f974fYwKBgApGZpuoI0PkV9gg4Xn5bD0IP9tw0d2Lp6YTwTdovUH+toCSvIlocZo4txR5Uktf/oi68AxdBOONdQUz5v7WMp8UoX+uEfmNHbuJcTidq5EZpXib7TW//587A/94Setvlh97HIjwzSTljyp9E2sj4oYElRZRQEslOkPCJ5y2gS0xAoGALLvOS40exdl94UZbB2u2+h7+k3/nIf0O+xSn84Ut8NgAnKzrTZDrXfmz1Ed2scNyHzt8NvhHCQ723ndofv55Yg7ufnqOg22eXuXORMG8cuWIcvnqdZ1sMPsdKc9vgBuP6R9VwwHj+8F0VN8UsW9aLxPRaKlbL0hlb+TSJRPI2KUCgYABjSgcpw5bAYss034g3Z22wyLdHsPsiYkm2sHWi6/kwbkJMV6tIJDPWKo/TGQ2Obxf3roaZ59pIrEa9Y3ZQ0n3l3OeDXhqKV0/+pQkTblzHiTi14O+lIrNEke0eJK2mpQRNKFLQAjOLLGtf6qxWCaysRjj/jy2KQBjSy1q9UnoIA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLJrXBvHqGoHqurGoHXj7QCukyGxX3pAU1EmGfJG38duJyBKWjq42ZQ2YJRHhi2dQaW6BpCxj9MNO5M1QNf3V0Z+0a5ZCjR5aqdw6oQX3bvMn3IA1uMcwcyPireHt2at/PE/8YBM3tnIBgHDKc5MuO8mmiQhjA693oEzjuRri58a1JQRvKjX6nY/mRURHwH4y52hej5OFyFXikrLVPPWXxkv0eFOpaPEMEUqyyHoLcTupnky2nKcsDBEGVqo2P97d6/mUhRsB7VzEh+Btg6IidU+QbCLKI5MEs5M4VFegrFYamh6G7d0VJBJH75ajUotpKhJhesD4L6LxxTJQ9MNYQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    // public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://localhost:9001/sbp-dev/myPay/toNotify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问(其实就是支付成功后返回的页面)
    // public static String return_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost:8080/myPay/succ";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关，这是沙箱的网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 日志存放的父级路径
    public static String log_path = "D:\\tmp\\";

//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}